package com.wgs.onomastici;

import android.app.AlertDialog;
import android.content.DialogInterface;

public class DialogFactory {

	public final static int DIALOG_INFO=0;
	
	public final static int DIALOG_ABOUT=1;
	
	
	
	public static AlertDialog.Builder createDialog(int type,final AbstractBaseActivity target){
		
		AlertDialog.Builder builder = new AlertDialog.Builder(target);
		
		switch (type) {
		case DIALOG_INFO:
			builder.setTitle("Onomastici");
		
			builder.setMessage(target.getInfoMessage());
			builder.setCancelable(true);
			builder.setPositiveButton("Torna all'applicazione",
					new DialogInterface.OnClickListener() {

						@Override
						public void onClick(DialogInterface dialog, int which) {
							dialog.dismiss();
							
						}
					});
			break;
		case DIALOG_ABOUT:
			builder.setTitle("About");
			builder.setMessage("Applicazione realizzata da:\n- Iachetti Walter\n- Iacuaniello Giacomo\n- Imperatrice Assunta");
			builder.setCancelable(true);
			builder.setPositiveButton("Torna all'applicazione",
					new DialogInterface.OnClickListener() {
						@Override
						public void onClick(DialogInterface dialog, int which) {
							dialog.dismiss();
							
						}
					});
			break;

		default:
			return null;
			
		}
		
		return builder;
	}
	
	
}
